def greedy_activity_selector(s,f):
    n=len(s)
    A=[1]
    i=0
    for m in xrange(1,n):
        if s[m]>=f[i]:
            A.append(m+1)
            i=m
    return A

if __name__=='__main__':
    s=[1,3,0,5,3,5,6,8,8,2,12]
    f=[4,5,6,7,8,9,10,11,12,13,14]
    print 's:', s
    print 'f:', f
    print 'ans:', greedy_activity_selector(s,f)
